package com.flynn.rock.crm.convert;

import com.flynn.rock.crm.entity.employee.EmployeeEntity;
import com.flynn.rock.crm.model.employee.request.SaveEmployeeRequest;
import com.flynn.rock.crm.model.employee.vo.EmployeeVo;
import com.flynn.rock.crm.model.employee.vo.ReceiveOrdersConfigVo;
import com.flynn.rock.system.model.dto.SaveUserDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public abstract class AbstractEmployeeConvert {

    public static final AbstractEmployeeConvert INSTANCE = Mappers.getMapper(AbstractEmployeeConvert.class);

    public abstract EmployeeEntity toEmployeeEntity(SaveEmployeeRequest request);

    public abstract SaveUserDto toUserDto(SaveEmployeeRequest request);

    public abstract ReceiveOrdersConfigVo toReceiveOrdersConfigVo(EmployeeEntity entity);

    @Mapping(target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    public abstract EmployeeVo toEmployeeVo(EmployeeEntity employeeEntity);
}
